﻿/*  Copyright 2012 PerceiveIT Limited
 *  This file is part of the Scryber library.
 *
 *  You can redistribute Scryber and/or modify 
 *  it under the terms of the GNU Lesser General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 * 
 *  Scryber is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Lesser General Public License for more details.
 * 
 *  You should have received a copy of the GNU Lesser General Public License
 *  along with Scryber source code in the COPYING.txt file.  If not, see <http://www.gnu.org/licenses/>.
 * 
 */

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Scryber.Styles;

namespace Scryber.Styles.Old
{
    public class PDFModifyPageStyle : PDFStyleItem
    {
        

        public PDFModifyPageStyle()
            : base(PDFObjectTypes.StyleModify, false)
        {
        }

        #region public ModificationType ModificationType {get;set;}

        private const string ModifyTypeKey = "type";
        /// <summary>
        /// Gets or sets the modification type to make to any existing or new content within a pdf file.
        /// </summary>
        [PDFAttribute(ModifyTypeKey)]
        public ModificationType ModificationType
        {
            get
            {
                object value;
                return this.GetEnumValue(ModifyTypeKey, typeof(ModificationType), false, out value) ? (ModificationType)value : ModificationType.None;
            }
            set
            {
                this.SetValue(ModifyTypeKey, value);
            }
        }

        #endregion

        #region public PDFContentRetention ContentRetention {get;set;}

        private const string ContentActionKey = "content-action";

        [PDFAttribute(ContentActionKey)]
        public ModifiedContentAction ContentAction
        {
            get
            {
                object value;
                return this.GetEnumValue(ContentActionKey, typeof(ModifiedContentAction), false, out value) ? (ModifiedContentAction)value : ModifiedContentAction.OnTop;
            }
            set
            {
                this.SetValue(ContentActionKey, value);
            }
        }

        #endregion

        #region public int PageStartIndex {get;set;}

        private const string PageIndexKey = "page-index";

        [PDFAttribute(PageIndexKey)]
        public int PageStartIndex
        {
            get
            {
                int value;
                return this.GetIntegerValue(PageIndexKey, false, out value) ? value : 0;
            }
            set
            {
                this.SetValue(PageIndexKey, value);
            }

        }

        #endregion

        #region public int PageCount {get;set;}

        private const string PageCountKey = "page-count";

        [PDFAttribute(PageCountKey)]
        public int PageCount
        {
            get
            {
                int value;
                return this.GetIntegerValue(PageCountKey, false, out value) ? value : 1;
            }
            set
            {
                this.SetValue(PageCountKey, value);
            }

        }

        #endregion
    }
}
